home *** CD-ROM | disk | FTP | other *** search
- on getday6
- set ltoday to the short date
- set lolddelimiter to the itemDelimiter
- if the machineType <> 256 then
- set the itemDelimiter to "."
- else
- set the itemDelimiter to "/"
- end if
- set ly to value(item 1 of ltoday)
- set lm to value(item 2 of ltoday)
- set ld to value(item 3 of ltoday)
- set the itemDelimiter to lolddelimiter
- if lm >= 5 then
- return 100
- end if
- if lm = 2 then
- return ld
- end if
- if lm = 3 then
- return ld + 28
- end if
- if lm = 4 then
- return ld + 28 + 31
- end if
- if lm <= 1 then
- if ld = 31 then
- return 0
- end if
- if ld = 30 then
- return -1
- end if
- if ld = 29 then
- return -2
- end if
- if ld < 29 then
- return 100
- end if
- end if
- end
-
- on getday7
- set ltoday to the short date
- set lolddelimiter to the itemDelimiter
- if the machineType <> 256 then
- set the itemDelimiter to "."
- else
- set the itemDelimiter to "/"
- end if
- set ly to value(item 1 of ltoday)
- set lm to value(item 2 of ltoday)
- set ld to value(item 3 of ltoday)
- set the itemDelimiter to lolddelimiter
- if lm >= 8 then
- return 200
- end if
- if lm = 3 then
- return ld
- end if
- if lm = 4 then
- return ld + 31
- end if
- if lm = 5 then
- return ld + 31 + 30
- end if
- if lm = 6 then
- return ld + 31 + 30 + 31
- end if
- if lm = 7 then
- return ld + 31 + 30 + 31 + 30
- end if
- if lm <= 1 then
- if ld = 31 then
- return 0
- end if
- if ld = 30 then
- return -1
- end if
- if ld = 29 then
- return -2
- end if
- if ld < 29 then
- return 100
- end if
- end if
- end
-
- on getday8
- set ltoday to the short date
- set lolddelimiter to the itemDelimiter
- if the machineType <> 256 then
- set the itemDelimiter to "."
- else
- set the itemDelimiter to "/"
- end if
- set ly to value(item 1 of ltoday)
- set lm to value(item 2 of ltoday)
- set ld to value(item 3 of ltoday)
- set the itemDelimiter to lolddelimiter
- if lm >= 11 then
- return 200
- end if
- if lm = 6 then
- return ld
- end if
- if lm = 7 then
- return ld + 30
- end if
- if lm = 8 then
- return ld + 30 + 31
- end if
- if lm = 9 then
- return ld + 30 + 31 + 30
- end if
- if lm = 10 then
- return ld + 30 + 31 + 30 + 31
- end if
- if lm <= 1 then
- if ld = 31 then
- return 0
- end if
- if ld = 30 then
- return -1
- end if
- if ld = 29 then
- return -2
- end if
- if ld < 29 then
- return 100
- end if
- end if
- end
-